<template>
    <div class="loc">
        <span class="left_span">您所在的位置：</span>    
        <el-breadcrumb separator-class="el-icon-arrow-right">
            <el-breadcrumb-item
                v-for="(item,index) in breadList"
                :key="index"
                :to="{ path: item.path }"
            ><span v-if="item.meta">{{item.meta.title}}</span></el-breadcrumb-item>
        </el-breadcrumb>
    </div>
</template>

<script>
    export default {
        props:{
            breadList:[Array]
        },
        // methods: {
        //     isHome(route) {
        //         return route.name === "index";
        //     },
        //     getBreadcrumb() {
        //         let matched = this.$route.matched;
        //         //如果不是首页
        //         if (!this.isHome(matched[0])) {
        //             matched = [{ path: "/index", meta: { title: "首页" } }].concat(matched);
        //         }
        //         this.breadList = matched;
        //     }
        // },        
        // created() {
        //      this.getBreadcrumb();
        // }          
    }
</script>

<style lang="scss" scoped>
    .loc /deep/ .el-breadcrumb{display: inline-block;    vertical-align: middle;}
    .left_span{font-size: 14px;    vertical-align: middle;}
</style>